The present invention relates generally to sample rate conversion techniques. More specifically, the present invention provides variable sample rate conversion techniques for synchronizing signals having sample rates which change with respect to each other over time.
Sample rate conversion techniques are used in a variety of contexts to facilitate system compatibility and interoperability. Such techniques may involve, for example, passing a sampled signal through a low pass filter, and then resampling the resulting waveform at the desired rate. When performed entirely in the digital domain, such techniques typically involve upsampling the signal, passing the upsampled signal through the digital equivalent of a low pass filter, and then downsampling the filtered signal to the desired sample rate. Commonly, conventional sample rate conversion techniques are employed to convert a signal from one sample rate to a significantly different sample rate, e.g., 36k samples per second to 44k samples per second, the ratio between the two rates, i.e., the sample rate conversion ratio, being fixed.
As digital signal processing techniques become more sophisticated, a variety of contexts are being discovered in which minor variations between sample rates in a system can be problematic for certain signal processing techniques and cause fairly dramatic and perceptible system performance degradation. For example, variations between the sample rates associated with two sound cards on either end of a digital audio transmission in a computer network can cause noticeable degradation in sound quality as well as undesirable delay. In another example, sample rate variations in a single computer system can undermine the operation of an echo cancellation technique which requires two signals to be closely synchronized.
Unfortunately, conventional sample rate conversion techniques are not effective in solving such problems because of the fact that the relationship between the sample rates of the signals to be synchronized are not always fixed. That is, it turns out that the clock rates for different sound cards and even for different circuitry within the same sound card are not only different, but that the difference typically varies over time in unpredictable ways. Thus, a sample rate conversion technique which uses a fixed conversion ratio is obviously not suitable.
In view of the foregoing, it is desirable to provide techniques by which signals having sample rates which vary over time with respect to one another may be synchronized.
According to the present invention methods and apparatus are provided by which signals having sample rates which vary with respect to each other over time may be synchronized. The drift between the sample rates is monitored and used on an ongoing basis to adjust the conversion ratio for a variable sample rate converter which effects the sample rate synchronization.
Thus, the present invention provides methods and apparatus for performing a variable sample rate conversion. A difference between a first sample rate associated with a first signal and a second sample rate associated with a second signal is tracked. A sample rate conversion ratio is adjusted in response to the difference. One of the first and second sample rates is converted using the conversion ratio.
According to one embodiment of the invention, methods and apparatus are provided for performing echo cancellation. A difference is tracked between a first sample rate associated with a first signal and a second sample rate associated with a second signal. A sample rate conversion ratio is adjusted in response to the difference. The first sample rate is converted using the conversion ratio, thereby generating a modified first signal and facilitating synchronization of the modified first signal and the second signal. Echo cancellation is performed using the modified first signal and the second signal.
According to a more specific embodiment, methods and apparatus are provided for performing echo cancellation. A difference is tracked between a first sample rate associated with a first signal and a second sample rate associated with a second signal by tracking a sample count in which samples associated with the first signal make a positive contribution to the sample count and samples associated with the second signal make a negative contribution to the sample count. A downsampling factor is adjusted using a feedback signal generated by a third order control system with reference to the difference. The first sample rate is converted using an upsampling factor, a filter, and the downsampling factor, thereby generating a modified first signal and facilitating synchronization of the modified first signal and the second signal. Echo cancellation is performed using the modified first signal and the second signal.
A further understanding of the nature and advantages of the present invention may be realized by reference to the remaining portions of the specification and the drawings.